package com.pekall.market.download;

import com.pekall.market.bean.AppListInfo;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Response;

/**
 * 静默安装回调监听
 * Created by WZG on 2016/10/20.
 */
public class LogInterceptor implements Interceptor {
    AppListInfo.ContentBean mBean;

    public LogInterceptor(AppListInfo.ContentBean bean) {
        this.mBean = bean;
    }

    @Override
    public Response intercept(Chain chain) throws IOException {
        Response originalResponse = chain.proceed(chain.request());
        mBean.setMd5(originalResponse.header("md5"));
        return originalResponse;
    }
}
